<?php

class ErrorHandledClass {

	var $oErrorStack;
	
	function ErrorHandledClass() {

		$this->oErrorStack  = new ErrorStack();
	}
	
	function Errored() {
		return $this->oErrorStack->HasErrors();
	}

	function SetErrorHandler() {
		$this->oErrorStack->SetErrorHandler( $this, 'AddError' );
	}
	
	function RestoreErrorHandler() {
		$this->oErrorStack->RestoreErrorHandler();
	}

	function AddError( $iErrorNumber = null, $sErrorText = null, $sErrorFile = null, $iErrorLine = null ) {
		$this->oErrorStack->AddError(  $iErrorNumber, $sErrorText, $sErrorFile, $iErrorLine );
	}
	
	function GetLastError() {
		return $this->oErrorStack->GetLastError();
	}
	
	function GetAllErrors() {
		return $this->oErrorStack->GetAllErrors();	
	}
	
}

require_once( 'Classes/ErrorStack.php' );

?>
